xend: pass-through: Implement least-mapping of virtual functions
This is an alternative to identity mapping virtual functions.
It works by assigning the numerically lowest virtual function that is
available.
* The order of assignment is thus dependent on the order that physical
functions are specified.
e.g.
config physical virtual
01.00.0,2 -> 01:00.0 -> 00:07.0
-> 01:00.2 -> 00:07.1
is different to
config physical virtual
01.00.2,0 -> 01:00.2 -> 00:07.0
-> 01:00.0 -> 00:07.1
* Physical function 0 need not be present
e.g.
config physical virtual
01.00.1,2 -> 01:00.1 -> 00:07.0
-> 01:00.2 -> 00:07.1
* Functions from the same physical multi-function device
may be exported as multiple multi-function and single-function
devices
e.g.
01.00.0,2 -> 01:00.0 -> 00:07.0
-> 01:00.2 -> 00:07.1
and
01.00.1,3 -> 01:00.1 -> 00:08.1
-> 01:00.3 -> 00:08.1
and
01.00.5 -> 01:00.5 -> 00:09.0
Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>